package io.rocketman.serialize;

import io.rocketman.common.plugin.PluginInterface;

import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author He Peng
 * @create 2018-05-26 15:05
 * @update 2018-05-26 15:05
 * @updatedesc : 更新说明
 * @see
 */

@PluginInterface("kryo")
public interface Serializer {

    byte[] serialize(Object obj);

    byte[] serialize(Object obj , int bufferSize);

    void serialize(OutputStream output, Object obj);

    void serialize(OutputStream output, Object obj , int bufferSize);

    <T> T deserialize(byte[] bytes , Class<T> cls);

    <T> T deserialize(byte[] bytes , Class<T> cls , int bufferSize);

    <T> T deserialize(InputStream input , Class<T> cls);

    <T> T deserialize(InputStream input , Class<T> cls , int bufferSize);

}
